package com.hu.controller;

import com.hu.bookstorecommon.entity.user;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.Map;

@Controller
public class borrowController {


    @RequestMapping("/borrow")
    public String goBorrow() {
        return ("book-borrow");
    }

    @RequestMapping("/aaa")
    @ResponseBody
    public Map<String, Object> addOneBook(Integer fid, HttpSession session) {
        Map<String, Object> result = new HashMap<>();
        user user = (user) session.getAttribute("user");
        if (user == null) {
            result.put("success", false);
            result.put("message", "借阅前请先登录");
        }else {




             result.put("message","1111");
        }
        return result;
    }
}
